package org.tea.inventory.enums;

import lombok.Getter;
import lombok.Setter;

/**
 * @author hanzy
 * @description
 * @date 2023年04月06日 14:03
 */
public enum CommonStatusEnum {
    DELETED(-1, "删除"),
    DISABLE(0, "关闭"),
    ENABLE(1, "开启"),
    EXPIRE(2, "过期");

    @Getter
    @Setter
    private Integer code;
    @Getter
    @Setter
    private String content;

    CommonStatusEnum(Integer code, String content) {
        this.code = code;
        this.content = content;
    }

    public static String getContentByName(Integer code) {
        for (CommonStatusEnum productAttributeEnum : CommonStatusEnum.values()) {
            if (productAttributeEnum.getCode() == code) {
                return productAttributeEnum.getContent();
            }
        }
        return "";
    }
}
